package net.wofly.cashier.order.domain;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.List;

/**
 * @author lign
 * @version 1.0
 * @created 17-10月-2017 21:57:05
 */
@Data
@Entity
@Table(name = "cashier_order_order")
@ApiModel(description = "订单")
public class Order {
    
    @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
    @JoinColumn(name = "orderID")
    @ApiModelProperty(value = "点菜内容，菜品清单", required = true)
    public List<OrderContent> orderContents;
    //public AddContent m_AddContent;
    //public PayInfo m_PayInfo;
    @Id
    private String orderID;
    /**
     * 加菜时间
     */
    private Long addDishTime;
    private Long modifyDate;
    /**
     * 开台时间
     */
    private Long openTableTime;
    @ApiModelProperty(value = "订单编号", required = true)
    private String orderNo;
    private Integer orderStatus;
    /**
     * 下单时间
     */
    private Long orderTime;
    /**
     * 订单类型
     */
    @ApiModelProperty(value = "订单类型", required = true)
    private Integer orderType;
    private String orderUserID;
    /**
     * 预购或预约订单时，对应的预购或预约ID
     * 堂点时为空
     */
    private String relationID;
    /**
     * 桌号
     */
    @ApiModelProperty(value = "桌号", required = true)
    private String tableID;
    
    public Order() {
        
    }
    @Override
    public void finalize() throws Throwable {
        
    }
}//end order